package com.wj.ch2.event;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @program: wj_springBoot
 * @description: 事件监听器
 * @author: wj
 * @create: 2021-10-21 15:02
 **/
@Component
public class DemoListener implements ApplicationListener<DemoEvent> {


    @Override
    public void onApplicationEvent(DemoEvent demoEvent) {
        String msg = demoEvent.getMsg();
        System.out.println("我 bean-DemoListener 监听到了 bean-DemoPublisher 发布的信息："+msg);
    }
}
